#ifndef OPHIES_REQUEST_CALLBACK_H
#define OPHIES_REQUEST_CALLBACK_H

#include "irm_types.h"
#include "irm_datamodel.h"
#include <QNetworkReply>
#include <QAuthenticator>

namespace ophies {

	class DataModel;

class RequestCallback : public QObject
{
    Q_OBJECT

private:
    DataModelType m_callback_type;

public:
    RequestCallback(DataModelType type, QObject* parent);
	virtual ~RequestCallback();

private slots:
    void	onAuthenticationRequired ( QNetworkReply * reply, QAuthenticator * authenticator );
    void	onFinished ( QNetworkReply * reply );
	
private:
    void handlResponse( QNetworkReply *reply );

protected:
    virtual void myListHandler(QList<DataModel*>* list);
    virtual void myObjectHandler(DataModel* object);

};


/////////////////////////////////////////////////
/// \brief The PatientsCallback class
/////////////////////////////////////////////////
class PatientsCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    PatientsCallback(QObject* parent);
    virtual ~PatientsCallback();

};

/////////////////////////////////////////////////
/// \brief The DcmStudiesCallback class
/////////////////////////////////////////////////
class DcmStudiesCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DcmStudiesCallback(QObject* parent);
    virtual ~DcmStudiesCallback();
};

////////////////////////////////////////////////
/// \brief The DcmSeriesCallback class
////////////////////////////////////////////////
class DcmSeriesCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DcmSeriesCallback(QObject* parent);
    virtual ~DcmSeriesCallback();
};

//////////////////////////////////////////////////
/// \brief The DcmInstancesCallback class
//////////////////////////////////////////////////
class DcmInstancesCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DcmInstancesCallback(QObject* parent);
    virtual ~DcmInstancesCallback();

};

//////////////////////////////////////////////////
/// \brief The DocsetCallback class
//////////////////////////////////////////////////
class DocsetsCallback : public ophies::RequestCallback
{
    Q_OBJECT

public:
    DocsetsCallback(QObject* parent);
    virtual ~DocsetsCallback();
};

}
#endif // PATIENTSCALLBACK_H
